package jonggyuni.basic;

import java.util.Scanner;

public class Tax {

	public static void main(String[] args) {
		// 연봉과 결혼 여부 입력.
		// 1. 미혼 
		//    1)연봉 3000미만->10% 2)연봉 3000이상-25%
		// 2. 결혼
		//    1)연봉 6000미만->15% 2)연봉 6000이상-35%
		
		Scanner sc = null;
		String isMarried = null; //결혼 여부

		int married;
		int salary;//연봉
		int tax=0;//세금
		
		sc = new Scanner(System.in);
		System.out.println("결혼여부는 ?"+"(미혼 : 0, N / 기혼: 1, Y)");
		//isMarried = sc.nextInt();
		married = sc.nextInt();
		
		System.out.println("연봉은 ?");
		salary = sc.nextInt();
				
		// 표현식에서 문자열 비교는 == 연산자로 할 수 없음,
		// 문자열은 객체 object형이기 때문
		//
		if(married == 0){//미혼
			if(salary<3000){
				tax = (int)(salary * 0.1);
			}
			else
				tax = (int)(salary * 0.25);
			isMarried = "미혼";
		}else if(married == 1){//기혼
			if(salary<6000){
				tax = (int)(salary * 0.15);
			}
			else
				tax = (int)(salary * 0.35);	
			isMarried = "기혼";
		}
		System.out.println("결혼 여부: " + isMarried);
		System.out.println("연봉 : " + salary);
		System.out.println("세금 : " + tax);
/*		if(isMarried == "미혼"){
			System.out.println("미혼!");
		}
		else if(isMarried == "기혼"){
			System.out.println("기혼");
		}*/
		
		sc.close();
/*		
		int marry;
		double salary;
		
		sc = new Scanner(System.in);
		
		System.out.print("1.결혼 , 2.미혼 :");
		marry = sc.nextInt();
		
		System.out.print("당신의 연봉을 입력하세요 : ");
		salary = sc.nextInt();
		
		if(marry == 1){
			if(salary <3000.0){
				System.out.println("세금은 10%");
				System.out.println("세금 : " + (int)(salary*0.1) );
			}
			else{
				System.out.println("세금은 25%");
				System.out.println("세금 : " + (int)(salary*0.25));
			}
		}
		else if(marry == 2){
			if(salary < 6000.0){
				System.out.println("세금은 15%");
				System.out.println("세금 : " + (int)(salary*0.15) );
			}
			else{
				System.out.println("세금은 35%");
				System.out.println("세금 : " + (int)(salary*0.35) );
			}

		}*/
	}

}
